//pack11--jsclass

var AjaxManager = new ajaxManager();

function ajaxManager() {

    this.url="?search";
    this.variables=new Array();
    this.backHandler = function(text,xml){}

    this.callServer = function () {
        this.xmlHTTP.backHandler=this.backHandler;
        if(!this.xmlHTTP) return;

        var params=this.variables.join("&");
        //trace(params);

        this.xmlHTTP.open("POST",this.url,true);
        this.xmlHTTP.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        this.xmlHTTP.setRequestHeader("Content-length", params.length);
        this.xmlHTTP.setRequestHeader("Connection", "close");
        this.xmlHTTP.send(params);
    }
    
    this.getXmlHttpObject = function() {
        if (window.XMLHttpRequest) { // IE7+, Firefox, Chrome, Opera, Safari
            return new XMLHttpRequest();
        }

        if (window.ActiveXObject) { // IE6, IE5
            return new ActiveXObject("Microsoft.XMLHTTP");
        }

        return false;
    }
    this.xmlHTTP = this.getXmlHttpObject();

    this.xmlHTTP.onreadystatechange = function() {
        //trace(this.parent);
        if (this.readyState==4) {
            //trace("resp:"+this.responseText);
            this.backHandler(this.responseText, this.responseXML);
        }
    }
}

function ajaxVar() {
    this.name="ajaxVar";
    this.value="undefined";

    this.query = function() {
        return this.name+"="+this.value;
    }
}